package com.biz.primus.ms.commodity.trans;

import com.biz.primus.commodity.vo.backend.GroupProductItemItemVo;
import com.biz.primus.ms.commodity.dao.po.GroupProductItem;
import com.google.common.base.Function;

import javax.annotation.Nullable;

public class GroupProductItem2GroupProductItemItemVo implements Function<GroupProductItem,GroupProductItemItemVo> {
    @Nullable
    @Override
    public GroupProductItemItemVo apply(@Nullable GroupProductItem input) {
        GroupProductItemItemVo respVo = new GroupProductItemItemVo();
        respVo.setId(String.valueOf(input.getId()));
        respVo.setItemName(input.getProduct().getName());
        respVo.setItemProductCode(input.getProduct().getProductCode());
        respVo.setQuantity(input.getQuantity());
        respVo.setPriceFactor(input.getPriceFactor());
        respVo.setProductCode(input.getParent().getProduct().getProductCode());
        respVo.setUpdateTimeStamp(input.getUpdateTimestamp());
        return respVo;
    }
}
